package cre.sample.test.gc.oom;

/**
 * java方法的内存模型，栈帧
 * VM Args: -Xss128k
 * -Xss java栈设置参数
 * Created by CreGu on 2016/5/24.
 */
public class JavaVMStackSOF {

    private int stackLength = 1;

    public void stackLeek() {
        stackLength++;
        stackLeek();
    }

    public static void main(String[] args) throws Throwable {
        JavaVMStackSOF javaVMStackSOF = new JavaVMStackSOF();
        try {
            javaVMStackSOF.stackLeek();
        } catch (Throwable throwable) {
            System.out.println("stack length" + javaVMStackSOF.stackLength);
            throw throwable;
        }
    }
}
